package com.baichuan.zntx.handler;

import com.baichuan.zntx.domain.LoraMessage;
import com.baichuan.zntx.service.IMessageHandlerService;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author mazhanliang
 */
public class LoraJsonHandler extends SimpleChannelInboundHandler<LoraMessage> {

    private IMessageHandlerService messageHandlerService;

    public LoraJsonHandler(IMessageHandlerService messageHandlerService) {
        this.messageHandlerService = messageHandlerService;
    }
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, LoraMessage loraMessage) throws Exception {
        //todo 处理业务逻辑
        if(this.messageHandlerService != null){
            //this.messageHandlerService.processMessage(channelHandlerContext, loraMessage);
        }
    }
}
